﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Cesave.Infrastructure.CrossCutting.Hashing;

namespace Cesave.Infrastructure.CrossCutting.Tests
{
    [TestClass]
    public class SaltAndHashTests
    {
        [TestMethod]
        public void HashCompare_Invoke()
        {
            // Arrange
            string hash1 = SaltAndHash.Hash("HashTest");
            string hash2 = SaltAndHash.Hash("HashTest");

            string hash3 = SaltAndHash.Hash("HashTest");
            string hash4 = SaltAndHash.Hash("AnotherHashTest");

            // Act
            bool match = SaltAndHash.HashCompare(hash1, hash2);
            bool noMatch = SaltAndHash.HashCompare(hash3, hash4);

            // Assert
            Assert.IsTrue(match);
            Assert.IsFalse(noMatch);
        }
    }
}
